xend: pass-through: Extend multi-function mapping
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Aug 2009 11:03:53 +0000 (12:03 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Aug 2009 11:03:53 +0000 (12:03 +0100)
commitce09aeeba7664b75301fb2f1290439bf0b4e788a
treefe0febc8bfb5c3ac6ba48b85e7c5508de7b9544f
parentbc60687a5067e118d481ba03e1bc236ca3c30ed9
xend: pass-through: Extend multi-function mapping

This extends the mapping between physical and virtual PCI functions
for multi-function pass-through in two ways. If neither of these
rules apply the existing identity-mapping of physical to virtual
functions is used.

1) If physical function zero is not present in a multi-function
   pass-through device then the numerically lowest physical function
   whose virtual function hasn't explicitly been set will be mapped
   to virtual function 0.

   This is to satisfy the requirement that a (virtual) device
   must always have function 0 present.

2) The virtual function to be used for a physical function may
   be explicitly set.

   e.g. 00:1d.2=3D0,1=3D1,0=3D2@7 will result in the following
   mapping:

        physical | virtual
        ---------+--------
        00:1d.2  | 00:07.0
        00:1d.1  | 00:07.1
        00:1d.0  | 00:07.2

   Ranges may also be used with explicit assignment.
   The following would result in the same mapping as above:

       00:1d.2=3D0-0=3D2@7

Please be aware that it is very likely that using these extensions
it is possible to create mappings that do not work. If in doubt
please use identity-mapping.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/util/pci.py